<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Vue生命周期</title>
    <script src="js/vue.js"></script>
</head>
<body>

<!--2.编写视图-->
<div id="app">
    <input v-model="username">
</div>

<script>
    // 1.创建Vue对象, el找到vue操作的的标签, data是vue中的数据
    new Vue({
        el: "#app",
        data: {
            username: "abc"
        },
        methods: {

        },
        created() {
            console.log("创建完成")
        },
        mounted() {
            console.log("Vue渲染视图完毕,向服务器请求数据!");
            alert("Vue渲染视图完毕!")
        },
        updated() {
            console.log("更新后")
        },
        destroyed() {
            console.log("销毁")
        }
    });
</script>
</body>
</html>